#include <iostream>

#include "glue.h"

int recv_message(SOCKADDR_IN& sa_in, const char* mes);
int recv_file_init(SOCKADDR_IN& sa_in, FileInfo& finfo);
int recv_file(SOCKADDR_IN& sa_in, std::string& filepath, int progress);
int send_file(SOCKADDR_IN& sa_in, std::string& filepath);
int send_message(SOCKADDR_IN& sa_in, const char* mes);


int recv_message(SOCKADDR_IN& sa_in, const char* mes)
{
    std::cerr << "Recv Msg from :";
    std::cerr << inet_ntoa(sa_in.sin_addr) << " : " << sa_in.sin_port << std::endl
            << "\t" << mes << std::endl;
    return 0;
}

int recv_file_init(SOCKADDR_IN& sa_in, FileInfo& finfo)
{
    std::cerr << "Recv File Request from :";
    std::cerr << inet_ntoa(sa_in.sin_addr) << " : " << sa_in.sin_port << std::endl
            << "\t" << finfo.pathname << std::endl
            << "\t" << finfo.filename << std::endl
            << "\t" << finfo.filesize << std::endl
            << "\t" << &finfo << std::endl;
    return 0;
}

int recv_file(const std::string& filepath, int progress)
{

    std::cerr << "Recv File Content from :";
    std::cerr << "\t" << filepath << std::endl
            << "\t" << progress << std::endl;
    return 0;
}

int send_file(const std::string& filepath, int progress)
{
    std::cerr << "Send File Content to :";
    std::cerr << "\t" << filepath << std::endl
            << "\t" << progress << std::endl;
    return 0;
}

int send_file_init(SOCKADDR_IN &sa_in, const std::string &filepath, FileInfo& finfo)
{
    std::cerr << "send new File to :";
    std::cerr << inet_ntoa(sa_in.sin_addr) << " : " << sa_in.sin_port << std::endl
            << "\t" << finfo.pathname << std::endl
            << "\t" << finfo.filename << std::endl
            << "\t" << finfo.filesize << std::endl
            << "\t" << &finfo << std::endl;
    return 0;
}
